package HeiMa.CollectionStudy.单列;

class Singleton{
    private static  Singleton INSTANCE;
    private Singleton(){}
    public static Singleton getInstance(){
        if(INSTANCE == null){
            INSTANCE = new Singleton();
        }
        return INSTANCE;
    }
    public void print(){
        System.out.println("www.mldn.cn");
    }
}


public class demo1 {
    public static void main(String[] args) {
        Singleton instance = null;
        instance = Singleton.getInstance();
        instance.print();
    }
}
